package org.lovely.base.web;

import com.baomidou.mybatisplus.core.metadata.IPage;
import org.lovely.common.base.dto.QueryBaseDataDTO;
import org.lovely.base.domain.entity.BaseData;
import org.lovely.base.service.BaseDataService;
import org.lovely.common.base.vo.BaseDataVo;
import org.lovely.common.dto.BasePage;
import org.lovely.common.dto.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * description:
 * </p>
 *
 * @author kaitong.wang@hand-china.com 2021/3/30 12:31 星期二
 */
@RestController
@RequestMapping("/baseData")
public class BaseDataController {

    @Autowired
    private BaseDataService baseDataService;

    @PostMapping("/getList")
    public Result<IPage<BaseData>> getList(@RequestBody QueryBaseDataDTO query ){
        return  baseDataService.getList(query);

    }
    @PostMapping("/add")
    public Result add(@RequestBody BaseData baseData){
        return baseDataService.add(baseData);
    }
}